function switch_tab(tab){
  /*
     Switch tab colors
   */
  tab_id = "tab_" + tab;
  tabs = getElementsByClass("tab");
  for (i = 0; i < tabs.length; i ++){
    tabs[i].style.color = "#cccccc";
  }
  tab_element = document.getElementById(tab_id);
  tab_element.style.color = "#ff7700";

  /*
     Switch show/hide state of content
   */
  tab_contents = getElementsByClass("tab_content");
  for (i = 0; i < tab_contents.length; i ++){
    tab_contents[i].style.display = "none";
  }
  content_id = "content_" + tab;
  Effect.toggle(content_id,'blind');
}

function set_focus(){
  var bFound = false;
  // for each form
  for (f=0; f < document.forms.length; f++)
  {
    // for each element in each form
    for(i=0; i < document.forms[f].length; i++)
    {
      // if it's not a button
      if (document.forms[f][i].type != "submit")
      {
	    // if it's not a hidden element
        if (document.forms[f][i].type != "hidden")
        {
          // and it's not disabled
          if (document.forms[f][i].disabled != true)
          {
            bFound = true;
            // set the focus to it
            document.forms[f][i].focus();
          }
        }
      }
      // if found in this element, stop looking
      if (bFound == true)
        break;
    }
    // if found in this form, stop looking
    if (bFound == true)
      break;
  }
}//end set_focus